home *** CD-ROM | disk | FTP | other *** search
- Path: sun001.spd.dsccc.com!news
- From: David Hacker, PB1-2426 <dhacker@aplo285.spd.dsccc.com>
- Newsgroups: comp.lang.c
- Subject: Re: why get 9 strings only?
- Date: 25 Jan 1996 15:03:12 GMT
- Organization: DSC Communications Corporation, Plano, Texas USA
- Message-ID: <4e863g$t74@sun001.spd.dsccc.com>
- References: <4e51th$4bi@news.nevada.edu>
- NNTP-Posting-Host: aplo285.spd.dsccc.com
- X-Newsreader: NCSA Mosaic
-
-
- The scanf does not pick up the newline. So the first time through the for
- loop, it thinks there's a string already out there - that's why it appears
- that the for loop doesn't do anything the first time through.
-
- I'm not sure how to modify the scanf to get it to pick up the newline.
-
- However, you can replace the scanf call with a call to gets followed by
- a call to sscanf using the string returned by gets as input to sscanf.
-